<%@taglib uri="/WEB-INF/struts-html.tld"  prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html:form action="kelas.do?action=kelasAdd">
    <table cellpadding="1" cellspacing="1" width="100%">
        <tr class="netral">
            <td colspan="2"><bean:message key="kelas.kelas"/></td>
        </tr>
        <tr class="form">
            <td width="10%"><bean:message key="account.account"/></td>
            <td>:
                <html:select property="account">
                    <logic:iterate id="listAccount" name="listAccount">
                        <option value="<bean:write name="listAccount" property="id"/>"><bean:write name="listAccount" property="nama"/></option>
                    </logic:iterate>
                </html:select>
            </td>
        </tr>
        <tr class="form">
            <td><bean:message key="ruang.ruang"/></td>
            <td>:
                <html:select property="ruang">
                    <logic:iterate id="listRuang" name="listRuang">
                        <option value="<bean:write name="listRuang" property="id"/>"><bean:write name="listRuang" property="namaRuang"/></option>
                    </logic:iterate>
                </html:select>
            </td>
        </tr>
        <tr class="form">
            <td><bean:message key="workflow.workflow"/></td>
            <td>:
                <html:select property="workflow">
                    <logic:iterate id="listWorkflow" name="listWorkflow">
                        <option value="<bean:write name="listWorkflow" property="id"/>"><bean:write name="listWorkflow" property="namaStage"/></option>
                    </logic:iterate>
                </html:select>
            </td>
        </tr>
        <tr class="form">
            <td colspan="2" align="right"><input type="button" onclick="validate_form()" value="${buttonAdd}"/></td>
        </tr>
    </table>
</html:form>

<table cellpadding="1" cellspacing="1" width="100%">
    <tr class="netral">
        <td colspan="5"><bean:message key="label.tabel"/> <bean:message key="kelas.kelas"/></td>
    </tr>
    <tr class="header">
        <td><bean:message key="label.no"/></td>
        <td><bean:message key="account.account"/></td>
        <td><bean:message key="ruang.ruang"/></td>
        <td><bean:message key="workflow.workflow"/></td>
        <td><bean:message key="label.action"/></td>
    </tr>
    <logic:notEmpty name="listKelas">
        <c:forEach var="listKelas" items="${listKelas}" varStatus="row">
            <c:if test="${(row.count) % 2 == 0}"><tr class="over"></c:if>
            <c:if test="${(row.count) % 2 != 0}"><tr class="down"></c:if>
                <td width="5%"><c:out value="${row.count}"/></td>
                <td width="50%"><c:out value="${listKelas.account.nama}"/></td>
                <td width="20%"><c:out value="${listKelas.ruang.namaRuang}"/></td>
                <td width="10%"><c:out value="${listKelas.workflow.namaStage}"/></td>
                <td>
                    <html:link action="/kelas.do?action=kelasDelete" paramName="listKelas" paramProperty="id" paramId="id" styleClass="noLink">[ <bean:message key="label.delete"/> ]</html:link>
                </td>
            </tr>
        </c:forEach>
    </logic:notEmpty>
    <tr class="form">
        <td colspan="5">&nbsp;</td>
    </tr>
    <logic:empty name="listKelas">
        <tr class="form">
            <td colspan="5" align="center"><bean:message key="kelas.kelas"/> <bean:message key="label.isEmpty"/></td>
        </tr>
    </logic:empty>
</table>